package com.lsl.singleton_pattern.ticketmaker;

/**
 * @author Zed
 * @description
 * @date 2022/11/3 21:44
 */
public class Test {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                try {
                    System.out.println(Thread.currentThread().getName() + " : " + TicketMaker.getInstance().getNextTicketNumber());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }).start();
        }
    }
}
